<html>
<head>
<title>Pinboard Bookmarklet Generator</title>

<script type="text/javascript" language="javascript" src="js/lytebox.js"></script>
<link rel="stylesheet" href="css/lytebox.css" type="text/css" media="screen" />
<style>
body {
  font-family: helvetica, verdana, arial, sans-serif;
  margin: 10px;
  background-color: white;
  text-align: left;
  font-size: 90%;
  }
  
form.delform fieldset {
  margin-bottom: 10px;
}
form.delform legend {
  padding: 0 2px;
  font-weight: bold;
}
form.delform label {
  display: inline-block;
  line-height: 1.8;
  vertical-align: top;
}
form.delform fieldset ol {
  margin: 0;
  padding: 0;
}
form.delform fieldset li {
  list-style: none;
  padding: 5px;
  margin: 0;
}
form.delform fieldset fieldset {
  border: none;
  margin: 3px 0 0;
}
form.delform fieldset fieldset legend {
  padding: 0 0 5px;
  font-weight: normal;
}
form.delform fieldset fieldset label {
  display: block;
  width: auto;
}
form.delform label {
  width: 120px; /* Width of labels */
}
form.delform fieldset fieldset label {
  margin-left: 126px;
}
#displayDiv {
  float: right;
  padding: 5px;
  visibility: hidden;
}
</style>

<script>
function dl_get(name) {
	return document.getElementById(name)
}

function dl_genLink() {
       dl_get("displayDiv").style.visibility = "visible"
       link_name = "pinboard";

       url = [ "javascript:var%20e=document.createElement('script');",
			"e.setAttribute('language','javascript');",
			"e.setAttribute('src','http://t.rc.vc/pinboard/js/pinboard.js?username=",
			dl_get("username").value,
			"&password=",
			dl_get("password").value,
			"');e.setAttribute('id','pinboard_submitter');document.body.appendChild(e);void(0);"
		]
			
	link = dl_get("myBookmarklet")
	
	link.innerHTML=link_name
	link.href=url.join("")

        dl_get("displayDiv").style.visibility = "visible"
}
</script>

</head>

<body class="generator">

<h2>Pinboard bookmarklet generator</h2>
<p>
  The short form below is a <a href="http://pinboard.in/">Pinboard</a> bookmarklet generator. Add the generated link
  to your browser toolbar to bookmark pages. The bookmarklet uses a small modal window to post to Pinboard, preventing 
  any annoying popups from showing up.
</p>

<form class="delform">
<fieldset>
<legend>Pinboard Bookmarklet Details</legend>
<div>
  
<div id="displayDiv">
  <div>
    Bookmarklet: <a id="myBookmarklet" href="#"></a>
  </div>
  <div>
    Drag the newly created bookmarklet up to your Firefox menu bar.<br/>
    <!-- img src="bookmarklet.png"/ -->
  </div>
</div>

<ol>
  <li>
    <label for="username">Username</label>
    <input id="username" />
  </li>
  <li>
    <label for="password">Password</label>
    <input id="password" />
  </li>
</ol>
<a href="#" onClick="dl_genLink(); return false;">&lt;Generate Bookmarklet&gt;</a>
</div>
</fieldset>
</form>

<div align="right"><small>this bookmarklet generator uses code from <a href="http://www.somnambulance.net/delicious_bookmarklet.html">Brian O'Rourke</a>'s excellent bookmarklet generator</small></div>

<br /><br />

<div align="center">
  <a href="images/example.png" rel="lytebox" title="Example of the Delicious bookmarklet in action. You can see the bookmarklet in the upper right corner."><img src="images/example.png" width="500" /></a>
</div>

</body>
</html>
